package com.wuye.model;

import com.wuye.web.MenuType;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhanchi on 2016/6/17.
 */
public class Menus implements Serializable{
    private String types;
    private List<MenuDetail> menu;
    private String ss;
    public String getTypes() {
        return types;
    }

    public void setTypes(String types) {
        this.types = types;
    }

    public List<MenuDetail> getMenu() {
        return menu;
    }

    public void setMenu(List<MenuDetail> menu) {
        this.menu = menu;
    }

    public Menus(String types, List<MenuDetail> menu, String ss) {
        this.types = types;
        this.menu = menu;
        this.ss = ss;
    }

    public Menus() {
    }

    public String getSs() {
        return ss;
    }

    public void setSs(String ss) {
        this.ss = ss;
    }

    @Override
    public String toString() {
        return "Menus{" +
                "types='" + types + '\'' +
                ", menu=" + menu +
                ", ss='" + ss + '\'' +
                '}';
    }

    public List<Menu> convertType(List<Menu> menu){
        List<Menu> menus = new ArrayList<Menu>();
        for(Menu mm:menu){
            mm.setItemType(MenuType.valueOf(mm.getItemType()).getMenuType());
            menus.add(mm);
        }
        return menus;
    }
}
